import React,{useEffect} from "react";
import { useSelector} from 'react-redux';
import { useParams } from "react-router";
import {useUser} from '../../store/actions/index';

const User=function(){ 
    const {loginname}=useParams();
    // console.log(loginname);
    let {data,loading} = useSelector((state)=>state.user);
    // console.log(data,loading);
    // console.log(data.avatar_url);
    let getData=useUser();
    useEffect(() => {
        getData('sunboy25');
    }, [])
    return (
        <>
        user
        {
            data.avatar_url?<img src={data.avatar_url} />:''
        }
        </>
    )
}
export default User;